<?php
function cat_list($category ,$count,$cat_img,$len_content,$len_title){
?>
<dl class="tbox">
      <?php query_posts("showposts=$count&cat=$category")?>
	<div  class="widget widget_nav_menu panel panel-niit panel-primary"><div class="arrow"><a href="<?php echo get_category_link($category);?>">more</a></div><div class="panel-heading widgettitle"><a class="panel-header" href="<?php echo get_category_link($category);?>"><?php single_cat_title();  ?></a></div><div"><ul class="menu">
          <?php
          $i = 0;
          while (have_posts()) : the_post();

            if( $len_content > 0 and $i == 0) {
              ?>
              <div class="picat">
              <img style="float:left;" src="<?php if ($cat_img == "") {bloginfo('template_url'); ?>/images/cat5.jpg"<?php }else{echo $cat_img.'"';} ?> alt="" width="108px" height="80px">
              <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">

            <?php
             echo mb_strimwidth(get_the_title(),0,$len_title-4,"...");
            ?></a><br />

              <?php ///显示字数限制的文章标题结束 ?>

              <?php

              echo mb_strimwidth(strip_tags(apply_filters('the_content', get_the_content())), 0, $len_content,"...");

              ?>
              <a target="_blank" href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>" class="orange">[详细]</a>
              </div>
              <hr />
              <?php

            }
            else {
              ?>
              <li class="menu-item menu-item-type-custom menu-item-object-custom "><a target="_blank" href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
              <?php
                echo mb_strimwidth(get_the_title(),0,$len_title,"...");
//the_time('Y-m-d') ?>
              </a></li>
              <?php
            }
            $i = $i+1;
          endwhile; ?>
          </ul>
        </dd>
      </dl>
<?php
}
?>
